import processing.core.PGraphics;
//import java.awt.Robot;
//import java.awt.event.*;

/*------------------------------------------------------------------------------------------------------------------*/
public class Cursor extends TrackedObject {
  public Cursor(int theObjectID) {    
    myID = theObjectID;  
  }
/*------------------------------------------------------------------------------------------------------------------*/    
public void debugCursor(final PGraphics g) { 
    drawEdges(_myPosition.x,_myPosition.y);
    g.smooth();
    g.noFill();  
    g.stroke(1); 
    g.stroke(color(#FFFFFF));   
    g.ellipse(_myPosition.x, _myPosition.y, _myPosition.w, _myPosition.w); 
    g.stroke(color(#FFFFFF));
    g.fill(color(#FFFFFF),25);  
    g.ellipse(_myNextPosition.x, _myNextPosition.y, _myPosition.w+2, _myPosition.w+2); 
    g.stroke(color(#B72121));
    g.ellipse(_myPreviousPosition.x, _myPreviousPosition.y, _myPosition.w+15, _myPosition.w+15);    
    g.stroke(color(#FFFFFF));
    g.line(_myNextPosition.x, _myNextPosition.y,_myPreviousPosition.x, _myPreviousPosition.y); 
    g.stroke(color(#6FA0A3));
    g.fill(255);   
    g.text(" p:"+_myPosition.w,_myPosition.x+25, _myPosition.y-5); 
    g.text(" x:"+_myPosition.x,_myPosition.x+25, _myPosition.y+5); 
    g.text(" y:"+_myPosition.y,_myPosition.x+25, _myPosition.y+15);  
    g.text(" id:"+myID,_myPosition.x+25, _myPosition.y+25); 
    g.noSmooth(); 
    //g.textFont(font, _myPosition.w+1); 
    //g.fill(0); 
    //g.text(myID,_myPosition.x-(_myPosition.w+1), _myPosition.y+(_myPosition.w+1)); 
    //g.textFont(font, 12); 
    drawGrid(stgW,16,color(#FFFFFF)); 
  }   
/*------------------------------------------------------------------------------------------------------------------*/  
public void defaultCursor(final PGraphics g) {
    g.smooth();
    //g.noFill();  
    g.stroke(5);
    g.stroke(color(#000000));
    g.fill(color(#FFFFFF),200);  
    g.ellipse(_myPosition.x, _myPosition.y, _myPosition.w+10, _myPosition.w+10); 
    g.noSmooth(); 
    //g.noStroke(); 
  }   
/*------------------------------------------------------------------------------------------------------------------*/  
public void paintCursor() {
drawConfetti(myID, _myPosition.x, _myPosition.y, _myPosition.w); 
} 
/*------------------------------------------------------------------------------------------------------------------*/  
public void gestureCursor() {
//defaultMode=false;
//debugMode=false;
//paintMode=false;  
drawGestures(_myPosition.x, _myPosition.y, _myPreviousPosition.x, _myPreviousPosition.y); 
} 
/*------------------------------------------------------------------------------------------------------------------*/  
public void audioCursor() {
drawConfetti(myID, _myPosition.x, _myPosition.y, _myPosition.w); 
} 
/*------------------------------------------------------------------------------------------------------------------*/  
public void touchCursor() {   
updatePoints(_myPosition.x,_myPosition.y); 
boolean found=false; 
  for (int i=nr-1; i>=0; i--) { 
    if (!found) {
      R[i].register(_myPosition.x,_myPosition.y); 
      found=R[i].picked;                                 
    }; 
  }; 
}  
/*------------------------------------------------------------------------------------------------------------------*/  
}
void drawGrid(int grid_size, int spacing, color gColor)
{
  for(int i = -grid_size; i <= grid_size; i+=spacing)
  {
    stroke(gColor,10);
    beginShape(LINES);
    vertex(-grid_size,i);
    vertex(grid_size,i);
    endShape();
    beginShape(LINES);
    vertex(i,-grid_size);
    vertex(i,grid_size);
    endShape();
    noStroke();
  }
}

